using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class StateMachine
{
    public PlayerState CurrentState { get; private set; }

    public PlayerState LastState { get; private set; }

    public void Init(PlayerState InitState) 
    {
        CurrentState = InitState;
        CurrentState.Enter();
    }

    public void ChangeState(PlayerState nextState) 
    {
        CurrentState.Exit();
        LastState = CurrentState;
        CurrentState = nextState;
        CurrentState.Enter();
    }
}
